<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Title</title>
  </head>
  <body>
    <script>
      /**
       * 重复点位处理成单个点位方法
       * */
      let pointArr = [
        [-39.31942523123949, -93.36456298828126],
        [-52.55130616747368, -93.54034423828125],
        [-59.68022181066172, -93.54034423828125],
        [-63.754564363851166, -94.41925048828126],
        [-66.97414706181685, -93.54034423828125],
        [-69.45080610251667, -93.01300048828125],
        [-71.39303097751691, -93.54034423828125],
        [-71.05355640322682, -77.54425048828126],
        [-71.05355640322682, -59.79034423828126],
        [-71.05355640322682, -37.46612548828126],
        [-59.38917842312835, -83.12530517578126],
        [-59.567723306212955, -72.92999267578126],
        [-59.567723306212955, -60.44952392578126],
        [-59.38917842312835, -47.79327392578126],
        [-59.29955167361263, -39.88311767578126],
        [-59.29955167361263, -34.43389892578126],
        [-53.787671844350285, -34.78546142578126],
        [-45.50634690108342, -35.48858642578126],
        [-39.9602803542957, -35.84014892578126],
        [-32.15701248607009, -35.48858642578126],
        [-39.9602803542957, -35.84014892578126],
        [-32.15701248607009, -35.48858642578126],
      ]
      // 去除重复点位
      let arrs = pointArr.map((val) => {
        return val.toString()
      })
      console.log(new Set(arrs))
      let arr = Array.from(new Set(arrs))
      let points = {}
      pointArr.forEach((val) => {
        arr.forEach((item) => {
          if (item === val.toString()) {
            if (points[item]) {
              points[item]++
            } else {
              points[item] = 1
            }
          }
        })
      })
      console.log(points)
    </script>
  </body>
</html>
